package com.cmict.data.form.api.util.SubUtil;

import com.cmict.data.form.api.entity.dataobject.SysFormDO;
import com.cmict.data.form.api.entity.vo.SysFromDataColumnVo;
import com.cmict.data.form.api.service.SysCurrencyService;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;


/**
 * @description: 组件规则label value替换
 * @author: qiaoyu
 * @create: 2022-08-2 22:57
 **/
public class ElStaticStateUtil {
	private static SysCurrencyService sysCurrencyService;

	public static SysFromDataColumnVo staticState (SysFormDO sysFormDO , String value , int k , SysFromDataColumnVo vo) {
		JSONObject personData = JSON.parseObject(sysFormDO.getFormJsonUser());
		JSONArray fields = personData.getJSONArray("fields");
		for (int i = 0; i <fields.size() ; i++) {

		}
		JSONObject field = fields.getJSONObject(k);
		JSONObject config = field.getJSONObject("__config__");
		String tag = config.getString("tag");
		//下拉框
		if(tag.equals("my-select")){
			String tagIcon = config.getString("tagIcon");
			if(tagIcon.equals("select")){
				return ElSelectUtil.State(personData,value,k,vo);
			}
		}
		return vo;
	}
}

